<template>
	<view class="payment">
		<view class="order-price">
			<view class="price-title">订单金额</view>
			<view class="price-num">
				<text class="num-icon">￥</text>200
			</view>
		</view>
		<view class="method">
			<view class="method-item" v-for="(item,i) in payList" :key="i">
				<view class="pay">
					<image :class="item.type === 'weixin' ? 'pay-img_': 'pay-img'" :src="item.img_icon" mode=""></image>
					<view class="pay-m">{{ item.name }}</view>
				</view>
				<view class="option">
					<radio style="transform:scale(0.7)" :checked="item.type === current ? true: false" color="#d81e06"
						@tap="radioChecked(item)" />
				</view>
			</view>
		</view>
		<view class="confirm-pay" @tap="$Router.push({path: '/pages/order/order-detail'})">
			<view class="pay-btn">
				确认支付
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				payList: [{
						type: 'weixin',
						name: '微信支付',
						img_icon: '../../static/img/wx.png'
					},
					{
						type: 'alipay',
						name: '支付宝',
						img_icon: '../../static/img/alipay.png'
					},
					{
						type: 'balance',
						name: '余额支付',
						img_icon: '../../static/img/balance.png'
					}
				],
				current: 'weixin'
			};
		},
		methods: {
			radioChecked(item) {
				this.current = item.type
			}
		}
	}
</script>

<style lang="scss">
	page {
		// background-color: #ccc;
	}

	.payment {
		padding-top: 15rpx;
		.order-price {
			width: 714rpx;
			height: 190rpx;
			background-color: #ffffff;
			border-radius: 15rpx;
			margin: 0 auto 0 auto;
			padding: 53rpx 0 0 35rpx;
			box-sizing: border-box;

			.price-title {
				font-size: 24rpx;
				letter-spacing: 2rpx;
				color: #363636;
			}

			.price-num {
				font-size: 40rpx;
				font-weight: bold;
				color: #d81e06;
				margin-top: 25rpx;

				.num-icon {
					margin-right: 10rpx;
					font-weight: normal;
					font-size: 30rpx;
					color: #d81e06;
				}
			}
		}

		.method {
			margin-top: 15rpx;
			padding: 0 18rpx;
			background-color: #fff;

			.method-item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 30rpx 0 30rpx 25rpx;
				border-bottom: solid 1rpx #e5e5e5;

				.pay {
					display: flex;
					align-items: center;

					.pay-img {
						width: 36rpx;
						height: 36rpx;
					}

					.pay-img_ {
						width: 36rpx;
						height: 31rpx;
					}

					.pay-m {
						margin-left: 20rpx;
						font-size: 30rpx;
						letter-spacing: 3rpx;
						color: #333333;
					}
				}
			}

			.method-item:last-child {
				border-bottom: none;
			}
		}

		.confirm-pay {
			margin-top: 277rpx;
			display: flex;
			align-items: center;
			justify-content: center;

			.pay-btn {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 713rpx;
				height: 100rpx;
				background-color: #c60122;
				border-radius: 50rpx;
				font-size: 36rpx;
				letter-spacing: 4rpx;
				color: #ffffff;
			}
		}
	}
</style>
